package com.datang.litejvm.constant;

import com.datang.litejvm.print.Visitor;

public class ConstantNameAndTypeInfo extends ConstantInfo {
    public int tag = ConstantInfo.CONSTANT_NAME_AND_TYPE_INFO;
    private int nameIndex;
    private int descriptorIndex;
    private String value = "NameAndType";
    public ConstantNameAndTypeInfo(ConstantPool pool) {
        super(pool);
    }

    public int getTag() {
        return tag;
    }

    public int getNameIndex() {
        return nameIndex;
    }

    public void setNameIndex(int nameIndex) {
        this.nameIndex = nameIndex;
    }

    public int getDescriptorIndex() {
        return descriptorIndex;
    }

    public void setDescriptorIndex(int descriptorIndex) {
        this.descriptorIndex = descriptorIndex;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public  void accept(Visitor visitor){
        visitor.visit(this);
    }
}
